import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [{
  path: '/',
  name: 'index',
  component: () => import('../views/home.vue'),
  children: [{
    path: 'users',
    name: 'users',
    component: () => import('../views/users.vue')
  }, {
    path: 'goods',
    name: 'goods',
    component: () => import('../views/goods.vue')
  }, {
    path: 'orders',
    name: 'orders',
    component: () => import('../views/orders.vue')
  }, {
    path: 'rights',
    name: 'rights',
    component: () => import('../views/rights.vue')
  }, {
    path: 'roles',
    name: 'roles',
    component: () => import('../views/roles.vue')
  }, {
    path: 'params',
    name: 'params',
    component: () => import('../views/params.vue')
  }, {
    path: 'categories',
    name: 'categories',
    component: () => import('../views/categories.vue')
  }, {
    path: 'reports',
    name: 'reports',
    component: () => import('../views/reports.vue')
  }]

}, {
  path: '/login',
  name: 'login',

  component: () => import('../views/login.vue')
}]

const router = new VueRouter({
  routes
})

export default router